package Controller;

import javax.swing.JFrame;
import javax.swing.JPanel;

import GUI.FrameSystem;
import GUI.MainGui;
import GUI.SubscriptionOrderForManyCarsGui;
import GUI.SubscriptionOrderGui;
import GUI.SubscriptionsViewGui;

/**
 * this is the controller of the subscription. it will just run the GUI options get order (one car or many) and view orders.
 * @author Or Marx
 *
 */
public class SubscriptionOrder {
	public SubscriptionOrder()
	{
	}
	public void getOrder()
	{
		JFrame frame=FrameSystem.getFrame();
		SubscriptionOrderGui subOrder=new SubscriptionOrderGui();
		subOrder.setLastPanel((JPanel)frame.getContentPane());
		subOrder.setFrame(frame);
		frame.setContentPane(subOrder);
		frame.setVisible(true);
	}
	public void getOrderForManyCars()
	{
		JFrame frame=FrameSystem.getFrame();
		SubscriptionOrderForManyCarsGui subOrder=new SubscriptionOrderForManyCarsGui();
		subOrder.setLastPanel((JPanel)frame.getContentPane());
		subOrder.setFrame(frame);
		frame.setContentPane(subOrder);
		frame.setVisible(true);
	}
	public void viewOrders()
	{
		JFrame frame=FrameSystem.getFrame();
		SubscriptionsViewGui subOrder=new SubscriptionsViewGui();
		subOrder.setLastPanel((JPanel)frame.getContentPane());
		subOrder.setFrame(frame);
		frame.setContentPane(subOrder);
		frame.setVisible(true);
	}

}
